import { createSlice } from '@reduxjs/toolkit'
import menu from './menu'
const initialState = {
     menu,
     curMenu:'首页'
}


export const commontSlice = createSlice({
  name: 'commom',  
  initialState, 
  reducers: {
        setMenu(state,action){
            state.menu=action.payload;
        },
        setCurMenu(state,action){
            state.curMenu=action.payload
        }
  },
})


export const { setMenu,setCurMenu } = commontSlice.actions

export default commontSlice.reducer